package com.yuju.group.dao.impl;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.yuju.common.core.dao.AbstractBaseDao;
import com.yuju.group.dao.ISeqCodeDao;
import com.yuju.group.dao.entity.SeqCode;
import com.yuju.group.dao.mapper.SeqCodeMapper;
import com.yuju.group.model.SeqCodeModel;
import com.yuju.persist.base.mapper.BaseMapper;

/**
 * 
 * 类名：SeqCodeDaoImpl  <br />
 *
 * 功能：序列号Dao实现
 *
 * @author : xuehj <br />
 * @Date : 2017年12月2日 上午8:53:48  <br />
 * @version : 1.1 <br />
 */
@Repository
public class SeqCodeDaoImpl extends AbstractBaseDao<SeqCodeModel, SeqCode, String> implements ISeqCodeDao {
	@Autowired
	private SeqCodeMapper seqCodeMapper;
	
	@Override
	public BaseMapper<SeqCode, String> getMapper() {
		// TODO Auto-generated method stub
		return seqCodeMapper;
	}

	@Override
	public int initGroupSeqCode(String groupId) {
		return seqCodeMapper.initGroupSeqCode(groupId);
	}

	@Override
	public int initHotelSeqCode(String groupId, String hotelId) {
		return seqCodeMapper.initHotelSeqCode(groupId, hotelId);
	}

	@Override
	public SeqCodeModel getSeqCode(Map<Object, Object> map) {
		return convertP2M(seqCodeMapper.getSeqCode(map));
	}

	@Override
	public SeqCodeModel getSysSeqCode(Map<Object, Object> map) {
		return convertP2M(seqCodeMapper.getSysSeqCode(map));
	}

	@Override
	public int updateSysSeqCode(SeqCodeModel seqCodeModel) {
		return seqCodeMapper.updateSysSeqCode(seqCodeModel);
	}

}
